﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;

namespace FoundationLib.Ifc.Data
{
	/// <summary>
	/// Provides interfaces for access to data transactions.
	/// </summary>
	public interface ITransactionProvider
	{
		/// <summary>
		/// Gets the currently active transaction. Can return null if no active transaction exists.
		/// </summary>
		ITransaction Transaction
		{
			get;
		}

		/// <summary>
		/// Begins a new transaction.
		/// </summary>
		/// <returns>The initialised transaction</returns>
		ITransaction BeginTransaction();

		/// <summary>
		/// Begins a new transaction.
		/// </summary>
		/// <param name="isolationLevel">The transaction isolation level</param>
		/// <returns>The initialised transaction</returns>
		ITransaction BeginTransaction(IsolationLevel isolationLevel);
	}
}
